﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class chitiettin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            
        }
    }
    protected string LoadTinTuc()
    {
        string idnew = Request.QueryString["idnews"].ToString();
        string html = "";
        string checktour = "NULL";
        string sql = "select * from dev_news where idnews='"+idnew+"'";
        System.Data.DataTable dt = new System.Data.DataTable();
        dt = DataAccess.ExeSQLToDataTable(sql);
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                html += " <div class='all_tintuc'><div class='bor_tintuc'>";
                html += "  <img  ID='imgtintuc' class='img_tintuc' Align='Left' src='files_upload/images/news/" + dt.Rows[i]["picture"] + "'/>";
                html += " <a href='chitiettin.aspx?idnew=" + dt.Rows[i]["idnews"] + "'> <h4>" + dt.Rows[i]["title"].ToString() + "</h4></a> <p>" + dt.Rows[i]["sapo"].ToString() + "</p>";
                html += "<div style='padding-top:70px; padding-left:5px;' class='noidung'>" + dt.Rows[i]["body"].ToString() + "</div>";
                html += "</div>";
                html += "</div>";
            }
        }
        return html;
    }
       protected string LoadTinTucCungNhom()
    {
        string idnew = Request.QueryString["idnews"].ToString();
        string html = "";
        string checktour = "NULL";
        string sql = "select top(5) * from dev_news where idnews!='"+idnew+"'and checktour=0 and vemaybay=0 and status=1";
        System.Data.DataTable dt = new System.Data.DataTable();
        dt = DataAccess.ExeSQLToDataTable(sql);
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                html += " <li><a href='chitiettin.aspx?idnew=" + dt.Rows[i]["idnews"] + "'>"+dt.Rows[i]["title"]+"</a></li>";
            }
        }
        return html;
    }
    
}